/*  1:   */ package com.reremouse.rerebbs.web.mb;
/*  2:   */ 
/*  3:   */ import com.reremouse.rerebbs.dao.IBbsThreadDAO;
/*  4:   */ import com.reremouse.rerebbs.dao.IBbsZoneDAO;
/*  5:   */ import com.reremouse.rerebbs.model.BbsThread;
/*  6:   */ import com.reremouse.rerebbs.model.BbsZone;
/*  7:   */ import com.reremouse.util.Cat;
/*  8:   */ import com.reremouse.util.SpringHelper;
/*  9:   */ import java.io.PrintStream;
/* 10:   */ import java.io.Serializable;
/* 11:   */ import java.util.ArrayList;
/* 12:   */ import java.util.List;
/* 13:   */ import javax.annotation.PostConstruct;
/* 14:   */ import javax.faces.bean.ManagedBean;
/* 15:   */ import javax.faces.bean.ViewScoped;
/* 16:   */ import javax.faces.context.ExternalContext;
/* 17:   */ import javax.faces.context.FacesContext;
/* 18:   */ import javax.servlet.http.HttpServletRequest;
/* 19:   */ 
/* 20:   */ @ManagedBean
/* 21:   */ @ViewScoped
/* 22:   */ public class ThreadList
/* 23:   */   implements Serializable
/* 24:   */ {
/* 25:23 */   BbsZone zone = null;
/* 26:24 */   List<BbsThread> threads = new ArrayList();
/* 27:25 */   IBbsThreadDAO bbsThreadDAO = (IBbsThreadDAO)SpringHelper.getSpringBean("BbsThreadDAO");
/* 28:26 */   IBbsZoneDAO bbsZoneDAO = (IBbsZoneDAO)SpringHelper.getSpringBean("BbsZoneDAO");
/* 29:27 */   HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
/* 30:   */   
/* 31:   */   public BbsZone getZone()
/* 32:   */   {
/* 33:30 */     return this.zone;
/* 34:   */   }
/* 35:   */   
/* 36:   */   public void setZone(BbsZone zone)
/* 37:   */   {
/* 38:34 */     this.zone = zone;
/* 39:   */   }
/* 40:   */   
/* 41:   */   public List<BbsThread> getThreads()
/* 42:   */   {
/* 43:38 */     return this.threads;
/* 44:   */   }
/* 45:   */   
/* 46:   */   public void setThreads(List<BbsThread> threads)
/* 47:   */   {
/* 48:42 */     this.threads = threads;
/* 49:   */   }
/* 50:   */   
/* 51:   */   @PostConstruct
/* 52:   */   public void init()
/* 53:   */   {
/* 54:47 */     System.out.println("constructor:" + System.nanoTime());
/* 55:48 */     String temp = this.request.getParameter("id");
/* 56:49 */     Cat.println("I'm here!");
/* 57:50 */     if (temp != null)
/* 58:   */     {
/* 59:51 */       this.zone = this.bbsZoneDAO.findById(Long.valueOf(Long.parseLong(temp)));
/* 60:52 */       synDB();
/* 61:   */     }
/* 62:   */   }
/* 63:   */   
/* 64:   */   public void synDB()
/* 65:   */   {
/* 66:57 */     this.threads = this.bbsThreadDAO.findByZone(this.zone.getId().longValue());
/* 67:   */   }
/* 68:   */   
/* 69:   */   public void top(long id)
/* 70:   */   {
/* 71:62 */     this.bbsThreadDAO.topThread(id);
/* 72:63 */     synDB();
/* 73:   */   }
/* 74:   */   
/* 75:   */   public void unTop(long id)
/* 76:   */   {
/* 77:67 */     this.bbsThreadDAO.unTopThread(id);
/* 78:68 */     synDB();
/* 79:   */   }
/* 80:   */   
/* 81:   */   public void delete(long id)
/* 82:   */   {
/* 83:72 */     this.bbsThreadDAO.delete(id);
/* 84:73 */     synDB();
/* 85:   */   }
/* 86:   */ }


/* Location:           F:\jsp源码\蝙蝠论坛系统\rerebbs\WEB-INF\classes\
 * Qualified Name:     com.reremouse.rerebbs.web.mb.ThreadList
 * JD-Core Version:    0.7.0.1
 */